package com.dengbw.systemtransfer.mapper;

import com.dengbw.systemtransfer.interfaces.MyBaseMapper;
import com.dengbw.systemtransfer.model.db.SysUserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

/**
 * @author dengbw
 * @date 2021/11/2 4:55 下午
 */
@Mapper
public interface SysUserRoleMapper extends MyBaseMapper<SysUserRole> {

    @Update("UPDATE sys_user_role sur, sys_user su SET sur.tenant_id = su.ding_corp_id, sur.sub_tenant_id = su.sub_tenant_id WHERE su.user_id = sur.user_id AND sur.tenant_id IS NULL AND su.ding_corp_id = #{corpId}")
    void fixMenu(String corpId);
}
